import { req_info_remove_type } from '../../Classes/cla_req_info_remove_type';
import { sign_check_only_set_type_info } from './Classes/cla_sign_check_only_set_type_info';
import { get_db_cur_type } from './Func/get_db_cur_type';

export async function sign_out_cur_type_uni_id(
  cur_info: req_info_remove_type,
  cur_type_id: string
) {
  let db_cur_type = get_db_cur_type(cur_type_id);

  let sign_check_info = new sign_check_only_set_type_info(cur_info);

  let check_arr = await db_cur_type.find(sign_check_info).toArray();

  if (check_arr.length == 0) {
    return;
  }

  db_cur_type.deleteOne(sign_check_info);
}
